﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;


public partial class News_NewIndex : System.Web.UI.Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSThemes();        
    }
    private string _indexhtml;
    public string IndexHtml
    {
        set { _indexhtml = value; }
        get { return _indexhtml; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Init_List();
            this.Page.Title = "资讯中心 "+BasePage.WebTitle;
        }
    }
    private void Init_List()
    {
        StringBuilder Sb = new StringBuilder();
        DataSet ds = new BLL.NEWS().GetNewsIndexData(BasePage.GetNewIndexTop());
        if (ds != null)
        {
            for (int i = 0; i < ds.Tables.Count; i++)
            {
                if (ds.Tables[i].Rows.Count > 0)
                {
                    Sb.Append("<Div><ul>");
                    foreach (DataRow row in ds.Tables[i].Rows)
                    {
                        Sb.Append("<li>");
                        Sb.Append("<a href=\"New_" + row["NEW_ID"].ToString() + ".html\" target=\"_blank\">");
                        Sb.Append(row["New_TITLE"].ToString());
                        Sb.Append("</a>");
                        Sb.Append("</li>");
                    }
                    Sb.Append("<li>");
                    Sb.Append("<a href=\"NewType_" + ds.Tables[i].Rows[0]["New_Type"].ToString() + ".html\">");
                    Sb.Append("more");
                    Sb.Append("</a>");
                    Sb.Append("</li>");
                    Sb.Append("</ul></Div>");
                    Sb.Append("<br/>");
                }
            }
            IndexHtml = Sb.ToString();
        }
    }
}
